package com.ruoyi.testDeal.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.testDeal.domain.equInfo.JkDshshsjDjInfo;
import com.ruoyi.testDeal.service.IJkDshshsjDjInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 金属非金属带式输送机电动机参数Controller
 * 
 * @author ruoyi
 * @date 2024-04-10
 */
@RestController
@RequestMapping("/testDeal/dshshsjDjinfo")
public class JkDshshsjDjInfoController extends BaseController
{
    @Autowired
    private IJkDshshsjDjInfoService jkDshshsjDjInfoService;

    /**
     * 查询金属非金属带式输送机电动机参数列表
     */
    @GetMapping("/list")
    public TableDataInfo list(JkDshshsjDjInfo jkDshshsjDjInfo)
    {
        startPage();
        List<JkDshshsjDjInfo> list = jkDshshsjDjInfoService.selectJkDshshsjDjInfoList(jkDshshsjDjInfo);
        return getDataTable(list);
    }

    /**
     * 导出金属非金属带式输送机电动机参数列表
     */
    @Log(title = "金属非金属带式输送机电动机参数", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, JkDshshsjDjInfo jkDshshsjDjInfo)
    {
        List<JkDshshsjDjInfo> list = jkDshshsjDjInfoService.selectJkDshshsjDjInfoList(jkDshshsjDjInfo);
        ExcelUtil<JkDshshsjDjInfo> util = new ExcelUtil<JkDshshsjDjInfo>(JkDshshsjDjInfo.class);
        util.exportExcel(response, list, "金属非金属带式输送机电动机参数数据");
    }

    /**
     * 获取金属非金属带式输送机电动机参数详细信息
     */
    @GetMapping(value = "/{dshshsjDjid}")
    public AjaxResult getInfo(@PathVariable("dshshsjDjid") Long dshshsjDjid)
    {
        return success(jkDshshsjDjInfoService.selectJkDshshsjDjInfoByDshshsjDjid(dshshsjDjid));
    }

    /**
     * 新增金属非金属带式输送机电动机参数
     */
    @Log(title = "金属非金属带式输送机电动机参数", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody JkDshshsjDjInfo jkDshshsjDjInfo)
    {
        return toAjax(jkDshshsjDjInfoService.insertJkDshshsjDjInfo(jkDshshsjDjInfo));
    }

    /**
     * 修改金属非金属带式输送机电动机参数
     */
    @Log(title = "金属非金属带式输送机电动机参数", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody JkDshshsjDjInfo jkDshshsjDjInfo)
    {
        return toAjax(jkDshshsjDjInfoService.updateJkDshshsjDjInfo(jkDshshsjDjInfo));
    }

    /**
     * 删除金属非金属带式输送机电动机参数
     */
    @Log(title = "金属非金属带式输送机电动机参数", businessType = BusinessType.DELETE)
	@DeleteMapping("/{dshshsjDjids}")
    public AjaxResult remove(@PathVariable Long[] dshshsjDjids)
    {
        return toAjax(jkDshshsjDjInfoService.deleteJkDshshsjDjInfoByDshshsjDjids(dshshsjDjids));
    }
}
